Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple: Localization Schema #3475

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from

Conversation

dgovil
Copy link
Contributor

@dgovil dgovil commented Dec 20, 2024

Description of Change(s)

This PR includes the localization schema as defined previously in the Accessibility PR. As requested, it has been split out.

Overview (if applicable)

Proposal

def "Foo"(
    apiSchemas = ["LocalizationAPI:default", "LocalizationAPI:fr_CA"]
) {
    string localization:default:language = "en_US"
    string foo = "Hello"
    string foo:lang:fr_CA = "Bonjour"
}

Feedback and Remaining Work

It would be greatly appreciated if feedback could be provided with a focus on the schema first so we can nail down how to represent the data in the USD.

I have not wrapped any of the custom methods in Python yet, and will do so when we reach better consensus on the schema + API.

[ ] I have created this PR based on the dev branch

[ ] I have followed the coding conventions

[ ] I have added unit tests that exercise this functionality (Reference:
testing guidelines)

[ ] I have verified that all unit tests pass with the proposed changes

[ ] I have submitted a signed Contributor License Agreement (Reference:
Contributor License Agreement instructions)

This commit adds two applied API schemas to UsdUI as an attempt to make it a Universally Accessible Scene Description.

Disclaimer: This addition does not represent any future feature support in our products. These schemas are borne out of discussing the needs for the ecosystem to accommodate a wider range of users.

2. Localization schema as discussed at

## Overview
A brief overview of the two schemas:

### Accessibility API
[Proposal](https://github.com/PixarAnimationStudios/OpenUSD-proposals/tree/main/proposals/accessibility)

```
def "Foo"(
    apiSchemas = ["AccessibilityAPI:default"]
) {
    string accessibility:label = "Short Label"
    string accessibility:description = "A longer description of this prim"
    uniform token priority = "standard"
}
```

UsdUIAccessibilityAPI is a multiple apply schema.
Each instance has three attributes:

label: A short description of the prim
description: An extended description of the prim
priority: A hint to a runtime on how this instance should be valued

The default instance does not namespace itself with the instance name as we believe it will be the only one specified in many cases, and the excess namespace doesn't add clarity.

As a convenience, the API specifies a default name so users of Apply() do not need to specify a name most of the time.

### Localization API
[Proposal](https://github.com/PixarAnimationStudios/OpenUSD-proposals/tree/main/proposals/language)

```
def "Foo" (
    apiSchemas = ["LocalizationAPI:default", "LocalizationAPI:fr_CA"]
)
{
     uniform token localization:lang = "en_US"
     custom string foo = "Hello"
     custom string foo:lang:fr_CA = "Bonjour"
     custom string foo:lang:hi_IN = "नमस्ते"
}

```

UsdUILocalizationAPI is also a multiple apply schema.
However here it uses the multiple apply to denote what language are available or that a default localization is available on a prim.

It includes one attribute that doesn't use an instance name called `localization:langauge` which specifies the default language to assume.

All other applications are suffixed to properties with `:lang:<language>`

## Feedback and Remaining Work

It would be greatly appreciated if feedback could be provided with a focus on the schema first so we can nail down how to represent the data in the USD.

I also haven't finished wrapping the LocalizationAPI methods in Python because I would like to first get feedback on the C++ API so that I may iterate faster. Once we feel the API looks good, I'll handle the Python bindings and write appropriate tests for them as well.
@dgovil dgovil mentioned this pull request Dec 20, 2024
2 tasks
@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-10529

(This is an automated message. See here for more information.)

@jesschimein
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants